<!--
 * @Description: webview组件
 * @Author: xinqiao lxq1990.0716@qq.com
 * @Date: 2024-04-12
 * @LastEditors: xinqiao lxq1990.0716@qq.com
 * @LastEditTime: 2024-04-12
-->
<script lang="ts" setup>
  import { onMounted } from 'vue'
  import { ref } from 'vue'

  const props = defineProps<{ src: string }>()

  const onWebViewLoad = (e: any) => console.log('onWebViewLoad: ', e)
  const onWebViewError = (e: any) => console.log('onWebViewError: ', e)

  const webviewSrc = ref(props.src)

  //onMounted(() => (webviewSrc.value = props.src))
</script>

<template>
  <web-view :src="webviewSrc" @load="onWebViewLoad" @error="onWebViewError" />
</template>

<style lang="less" scoped></style>
